<script setup>
import { RouterView } from 'vue-router'
import { ElConfigProvider } from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import zhTw from 'element-plus/dist/locale/zh-tw.mjs'
import en from 'element-plus/dist/locale/en.mjs'
import { LOCALES } from '@/constants'

const locale = {
  [LOCALES.zhCn]: zhCn,
  [LOCALES.zhTw]: zhTw,
  [LOCALES.en]: en
}
</script>

<template>
  <el-config-provider :locale="locale[$i18n.locale ?? LOCALES.zhCn]">
    <RouterView />
  </el-config-provider>
</template>
